package com.ls.controller;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ls.config.satoken.SaTokenUtilPy;
import com.ls.controller.rule.model.QueryRuleModel;
import com.ls.entity.BlackList;
import com.ls.entity.Customer;
import com.ls.entity.SmsRule;
import com.ls.entity.SmsTemplate;
import com.ls.service.IBlackListService;
import com.ls.service.ISmsTemplateService;
import com.ls.utils.ResultData;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

import java.util.List;

/**
 * <p>
 * 电话黑名单 前端控制器
 * </p>
 *
 * @author pengyu
 * @since 2024-10-12
 */
@Api(value = "黑名单相关接口", tags = "黑名单相关接口")
@RestController
@RequiredArgsConstructor
@RequestMapping("/blackList")
public class BlackListController {
    private final IBlackListService service;
    /** 查询黑名单列表 */
    @GetMapping(value = "pageList")
    public ResultData pageList(String phone,Integer pageNum,Integer pageSize) {
        return service.pageList(phone,pageNum,pageSize);
    }

    /** 新增黑名单 */
    @PostMapping("add")
    public ResultData add(@RequestParam String phone) {
        return service.add(phone);
    }
    /** 删除黑名单 */
    @PostMapping("del")
    public ResultData del(@RequestParam Long blackId) {
        return service.del(blackId);
    }

}

